﻿@using Jb.Common.Extensions;
@{
    List<Jb.Web.ViewModels.CategoryViewModel> _ParentCategories = (from P in ApplicationCache.Categories orderby P.Name where P.ParentID == null select P).ToList();    
}
<!--Top Navigation Start-->
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">            
                <span class="icon-th-list icon-white"></span>
            </a>
            <a href="@Url.Content("~/Home")" title="Home" class="brand">JB Enterprise .NET</a>
            <div class="nav-collapse collapse">
                <ul class="nav pull-right">
            @if (SessionCache.CurrentUser == null)
            {                   
                <li><a href="@Url.Content("~/registration/jobseeker")" title="Sign Up as a Job Seeker">Sign Up</a></li>
                @*<li><a href="@Url.Content("~/account/logon")">Login</a>*@
                <li class="dropdown">
                    <a id="drop1" class="dropdown-toggle" data-toggle="dropdown" href="#">
                        Login <i class="icon-arrow-down icon-white"></i>
                    </a>                    
                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="drop1">                    
                        <li><a tabindex="-1" href="@Url.Content("~/account/logon")">As Job Seeker</a></li>
                        <li class="divider"></li>
                        <li><a tabindex="-1" href="@Url.Content("~/account/logon")?type=e">As Employer</a></li>                            
                    </ul>
                </li>
                @*</li>*@
                <li class="input-append">
                    <form class="navbar-search" method="post" action="@Url.Content("~/job/search")">
                        <input type="text" id="txtMasterSearch" name="keyword" value="" placeholder="Search Jobs ..." />
                        <button class="btn" type="submit">&nbsp;<i class="icon-search"></i>&nbsp;</button>
                    </form>
                </li>                
            }
            else
            {
                String userName = SessionCache.CurrentUser.UserName;
                if (UserInfo.IsAdmin && SessionCache.CurrentUser.Contact == null && SessionCache.CurrentUser.JobSeeker == null){
                    userName = String.Format("Admin -> {0}", userName);
                }
                else if (SessionCache.CurrentUser.Contact != null && SessionCache.CurrentUser.Contact.Name != AppConstants.ValueOf.UNKNOWN){
                    userName = SessionCache.CurrentUser.Contact.Name;
                }
                else if (SessionCache.CurrentUser.JobSeeker != null && SessionCache.CurrentUser.JobSeeker.Name != AppConstants.ValueOf.UNKNOWN){
                    userName = SessionCache.CurrentUser.JobSeeker.Name;
                }
                //Navigation Bar With User Name
                @*<li><a tabindex="-1" href="@Url.Content("~/private/account/dashboard")">Dashboard</a></li>*@
                <li>
                    <ul class="nav pull-right" role="navigation">
                        <li class="dropdown">
                            <a id="drop1" class="dropdown-toggle" data-toggle="dropdown" href="#">
                                @userName <i class="icon-arrow-down icon-white"></i>
                            </a>                    
                            <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="drop1">
                                @if (UserInfo.IsCompanyUser) {
                                <li><a tabindex="-1" href="@Url.Content("~/Private/Account/Dashboard")">Dashboard</a></li>
                                }
                                else if (UserInfo.IsAdmin) {
                                <li><a tabindex="-1" href="@Url.Content("~/Admin/Account/Dashboard")">Dashboard</a></li>
                                }
                                else {
                                <li><a tabindex="-1" href="@Url.Content("~/JobSeeker/Account/Dashboard")">Dashboard</a></li>
                                }
                                <li class="divider"></li>
                                <li><a tabindex="-1" href="@Url.Content("~/Account/Logoff")">Log Off</a></li>                            
                            </ul>
                        </li>                    
                    </ul>
                </li>
                <li class="input-append">
                    <form class="navbar-search" method="post" action="@Url.Content("~/job/search")">
                        <input type="text" id="txtMasterSearch" name="keyword" value="" placeholder="Search Jobs ..." />
                        <button class="btn" type="submit">&nbsp;<i class="icon-search"></i>&nbsp;</button>
                    </form>
                </li>
            }
                </ul>
            </div>@*  End of Menu Container Div*@
        </div>
    </div>
</div>
<!--Top Navigation End-->